package com.qf.utils;/*
 *保护你的大熊
 *2021/12/13
 *22:04
 */

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;

public class EsClient {
    /**
     * 获取es客户端
     * @return
     */
    public static RestHighLevelClient getClient(){

        HttpHost httpHost = new HttpHost("192.168.42.133",9200);

        RestClientBuilder builder = RestClient.builder(httpHost);

        RestHighLevelClient client = new RestHighLevelClient(builder);

        return client;
    }

}
